import request from "@/utils/request";
const API = {
    GETRIGHTtOPDATA_URL: '/api/api-gcxm/gcxm/core/sjjsc/getQzqsj',
    GETTOKEN_URL: '/api/api-uaa/oauth/user/token',
    GETRIGHTBOTTOMDATA_URL: '/api/api-gcxm/gcxm/core/sjjsc/getCylxfb',
    GETRIGHTCENTERDATA_URL: '/api/api-gcxm/gcxm/core/sjjsc/getCjdsjc'
}
export const reqGetRightTopData = (year) => {
    if (year) {
        return request.get(API.GETRIGHTtOPDATA_URL + `?year=${year}`)
    } else {
        return request.get(API.GETRIGHTtOPDATA_URL)
    }
}
export const reqGetToken = () => {
    return request.post(API.GETTOKEN_URL, {
        username: 'gzpi',
        password: 'Kfq@Cjsfzsp#122056.',
    },
    {
        headers:{
            "Content-Type":'application/x-www-form-urlencoded'
        }
    })
}
export const reqGetRightBottomData = (year)=>{
    if(year){
        return request.get(API.GETRIGHTBOTTOMDATA_URL + `?year=${year}`)
    }else{
        return request.get(API.GETRIGHTBOTTOMDATA_URL)
    }
}
export const reqGetRightCenterData = ()=> request.get(API.GETRIGHTCENTERDATA_URL)